/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package piu;

import classes.Informacoes;
import classes.serializa;
import javax.swing.ImageIcon;
import javax.swing.JComboBox;

/**
 *
 * @author Dalay
 */
public class ComidaEmCasaAPP extends javax.swing.JFrame {

    /**
     * Creates new form ComidaEmCasaAPP
     */
    public ComidaEmCasaAPP() {
        initComponents();
        cb.setMaximumRowCount(2);
        cb.setName("Endereço de entrega");
        im_ComidaEmCasaAPP.setIcon(imagem);
        Informacoes.pratos = s.deserializaLista();
        //CB = new JComboBox(ComboBox);
        
    }
    serializa s = new serializa();
        ImageIcon imagem = new ImageIcon("src/imagens/I.jpg");

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        label_ComidaEmCasaAPP = new javax.swing.JLabel();
        cb = new javax.swing.JComboBox();
        im_ComidaEmCasaAPP = new javax.swing.JLabel();
        button_acessoRestaurantes = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(255, 255, 255));

        label_ComidaEmCasaAPP.setFont(new java.awt.Font("Arial", 0, 24)); // NOI18N
        label_ComidaEmCasaAPP.setText("Comida Em Casa APP");

        cb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Escolher Restaurante", "Rest. Comidas Típicas" }));
        cb.setToolTipText("");
        cb.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbActionPerformed(evt);
            }
        });

        im_ComidaEmCasaAPP.setIcon(new javax.swing.ImageIcon("C:\\Users\\Dalay\\Documents\\NetBeansProjects\\PIU\\src\\Imagens\\I.jpg")); // NOI18N

        button_acessoRestaurantes.setText("Acesso para Restaurantes");
        button_acessoRestaurantes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_acessoRestaurantesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(35, 35, 35)
                                .addComponent(label_ComidaEmCasaAPP))
                            .addGroup(layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(im_ComidaEmCasaAPP)))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(button_acessoRestaurantes)))
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addGap(86, 86, 86)
                .addComponent(cb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(label_ComidaEmCasaAPP)
                .addGap(18, 18, 18)
                .addComponent(cb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(im_ComidaEmCasaAPP)
                .addGap(18, 18, 18)
                .addComponent(button_acessoRestaurantes)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        cb.getAccessibleContext().setAccessibleName("");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void button_acessoRestaurantesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_acessoRestaurantesActionPerformed
        new AcessoParaRestaurantes().setVisible(true);
        this.dispose();// TODO add your handling code here:
    }//GEN-LAST:event_button_acessoRestaurantesActionPerformed

    private void cbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbActionPerformed
        if (cb.getSelectedItem() == "Rest. Comidas Típicas"){
            new RestauranteComidasTipicas().setVisible(true);
            this.dispose();
        }
        else{
        }// TODO add your handling code here:
    }//GEN-LAST:event_cbActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ComidaEmCasaAPP.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ComidaEmCasaAPP.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ComidaEmCasaAPP.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ComidaEmCasaAPP.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ComidaEmCasaAPP().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton button_acessoRestaurantes;
    private javax.swing.JComboBox cb;
    private javax.swing.JLabel im_ComidaEmCasaAPP;
    private javax.swing.JLabel label_ComidaEmCasaAPP;
    // End of variables declaration//GEN-END:variables
}
